package cn.itcast.pojo;

import org.apache.solr.client.solrj.beans.Field;

import java.util.Arrays;

/**
 * 实体类,用于测试javaBean方式添加索引操作
 *
 * @Field该注解的作用是 指定其中一个document字段
 * 前提是必须先在solr中的schema.xml中提前定义好
 */

public class SolrPojo {
    @Field
    private String id; //商品id
    @Field
    private String[] title;//商品的标题
    @Field
    private String name;//商品的名称

    private String brand;//商品的品牌
    private String price;//商品的价格

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String[] getTitle() {
        return title;
    }

    public void setTitle(String[] title) {
        this.title = title;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "SolrPojo{" +
                "id='" + id + '\'' +
                ", title=" + Arrays.toString(title) +
                ", name='" + name + '\'' +
                ", brand='" + brand + '\'' +
                ", price='" + price + '\'' +
                '}';
    }
}
